define([ "PDAppDir/properties", 
		"PDUtilDir/slidebar", "PDUtilDir/grid",
		"css!AppPathDir/order/orderInfos/views/css/css" ], function(Properties,
		Slidebar, Grid) {
	function rebackRecodeSupportInit($scope, $compile) {
		return new rebackRecodeSupport($scope, $compile);
	}
	function rebackRecodeSupport($scope, $compile) {
		this.$scope = $scope;
		this.$compile = $compile;
	}
	rebackRecodeSupport.fn = rebackRecodeSupport.prototype;
	rebackRecodeSupport.fn.digest = function() {
		this.$scope.$digest();
	}
	rebackRecodeSupport.fn.run = function(data) {
		var _this = this;
		_this.entity = {
            orderNo: data
		};
		
		this.slidebars = Slidebar({
			size : 'lg',
			url : getServer() + "/static/app/order/serviceOrderInfos/views/rebackRecode.html",
//			close : true,
			$scope : this.$scope,
			$compile : this.$compile,
			afterLoad : function($Panel) {
				_this.initialization();
			}
		});
	};
	rebackRecodeSupport.fn.initialization = function() {
        var _this = this;

        $.ajax({
            url : getServer() + "/flea/hclv/serviceOrder/getServiceOrderRebackRecoder.htmls",
            data : {
                orderNo : this.entity.orderNo
            },
            success : function(data) {
            	if(data.status != 200){
					return;
				}
                Grid({
                    id : "OrderRebackRecodeGirdDivId",
                    pageSize : 10,
                    index : true,
                    multi : true,
                    pagination : false,
                    cache : false,
                    layout : [ {
                        name : "订单号",
                        field : "orderNo",
                        sort : false
                    }, {
                        name : "支付方式",
                        field : "payPlatform",
                        format : function(e) {
                            return _this.$scope.cache.typeMap.get(e.row.payPlatform);
                        }
                    }, {
                        name : "支付金额",
                        field : "rebackMoney",
                        sort : false
                    }, {
                        name : "流水号",
                        field : "platformNumber",
                        sort : false
                    }, {
                        name : "创建用户",
                        field : "createUserName",
                        sort : false
                    } ],
                    data : data.data
                })
            }
        });
	};
	return rebackRecodeSupportInit;
});